package com.iretailer.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iretailer.mapper.NotesMapper;
import com.iretailer.model.ItemNote;
import com.iretailer.model.Note;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class NotesService extends ServiceImpl<NotesMapper, Note> {

    @Autowired
    private NotesMapper notesMapper;

    public IPage<ItemNote> selectNotePage(Page<ItemNote> page, String siteId, String startTime, String endTime) {
        if (page == null) {
                page = new Page<>(1,Long.MAX_VALUE);
        }
        return page.setRecords(notesMapper.selectNotePage(page,siteId,startTime,endTime));
    }

}
